package com.ctshk.sapp.iotc.controller;


import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.model.PageResponse;
import com.ctshk.rpc.iotc.dto.OperationLogDTO;
import com.ctshk.rpc.iotc.req.OperationLogsReq;
import com.ctshk.rpc.iotc.service.IOperateLogsService;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.ctshk.common.web.support.BaseController;

import javax.validation.Valid;

/**
 * <p>
 * 操作日志表 前端控制器
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-01-27
 */
@RestController
@RequestMapping("/operate/logs")
public class OperateLogsController extends BaseController {

    @DubboReference
    private IOperateLogsService iOperateLogsService;

    @ApiOperation(value = "查询推广码操作日志",notes = "查询推广码操作日志")
    @OperationLogAnnotation(operModul = OperationLogModel.IOTC,operType = OperationLogType.QUERY, operTitle = "查询", operDesc = "查询推广码操作日志")
    @RequestMapping("/listLog")
    public Result<PageResponse<OperationLogDTO>> listLog(@RequestBody @Valid OperationLogsReq req){
        return Result.success(iOperateLogsService.list(req));
    }

}
